package com.bjpowernode.controller;

import com.bjpowernode.common.result.Result;
import com.bjpowernode.entity.vo.NameValueDataVO;
import com.bjpowernode.service.StatisticService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticService statisticService;

    @GetMapping("/api/summary/data")
    public Result summaryData(){
        return Result.OK(statisticService.summaryData());
    }

    @GetMapping("/api/sale/funnel")
    public Result saleFunnel(){
        return Result.OK(statisticService.getSaleFunnel());
    }

    @GetMapping(value = "/api/clue/pie")
    public Result cluePie() {
        List<NameValueDataVO> nameValueDataList = statisticService.getCluePieData();
        return Result.OK(nameValueDataList);
    }



}
